  var headerbar = '\
  <div>\
	<div style="float: left; width:350px;">\
		  <img width="40" height="40" style="margin-top: 10px;float: left;" src="./images/logo.png"/>\
		  <div style="margin-top: 18px;margin-left: 12px;float: left; font-size: 18px;color:white;">\
		  龙羲垣企业服务共享中心\
		  </div>\
		  <i class="el-icon-s-fold icon" @click="siderbarHide"></i>\
	</div>\
	<div style="float: right;">\
		<div style="float: right; ">\
			<i class="el-icon-warning-outline icon"></i>\
			<i class="el-icon-chat-dot-round icon"></i>\
			<el-dropdown>\
			  <span class="el-dropdown-link">\
			<i class="el-icon-user icon"></i>\
			  </span>\
			  <el-dropdown-menu slot="dropdown">\
				<el-dropdown-item icon="el-icon-user ">{{username}}</el-dropdown-item>\
				<el-dropdown-item icon="el-icon-switch-button" @click.native="logout">退出系统</el-dropdown-item>\
			  </el-dropdown-menu>\
			</el-dropdown>\
	  </div>\
	</div>\
  </div>\
  '

// 定义一个名为 headerbar 的新组件
Vue.component('headerbar', {
  data: function () {
	return {
		isHide:false,
		username:localStorage.getItem('USERNAME')
	}
  },
  methods: {
	siderbarHide(){
		this.isHide = !this.isHide;
		Event.$emit("sideevent", this.isHide);
	},
	logout(){
	  localStorage.setItem('TOKEN',"")
	  localStorage.setItem('USERID',"null")
	  localStorage.setItem('USERNAME',"")
	  location.href="login.html";
	}
  },
  template: headerbar
})